package net.fkrahe.graph;

/**
 * Class ArcNode
 * 
 * @author Yedidyah Langsan | Moshe Augenstein | Aaron M. Tenenbaum
 */
public class ArcNode {

    protected GraphNode ptr;

    public ArcNode() {
        ptr = null;
    }

    public ArcNode(GraphNode gn) {
        ptr = gn;
    }

    public GraphNode getPtr() {
        return ptr;
    }

    public void setPtr(GraphNode d) {
        ptr = d;
    }

    /**
     * Returns 
     * @param o
     * @return true if ptr fields point to the same object
     */
    public boolean equals(Object o) {
        if (!(o instanceof ArcNode)) {
            return false;
        }
        ArcNode tmp = (ArcNode) o;
        return (ptr == tmp.ptr);
    }
}
